<?php

ini_set('display_errors', 1);
error_reporting(-1);
require_once '/data/wwwroot/g_vendor/autoload.php';
use Biz\model\activity\CouponConfig as mCouponConfig;

$id = 0;
$couponInfo = mCouponConfig::get('*', [
	'start_show_time' => '0000-00-00 00:00:00',
	'stop_show_time' => '0000-00-00 00:00:00',
	'type_time' => mCouponConfig::TYPE_TIME_STATIC,
	'coupon_id[>]' => $id,
	'ORDER' => ['coupon_id' => 'ASC']
]);

while ($couponInfo) {
	mCouponConfig::upData($couponInfo['coupon_id'], [
		'start_show_time' => $couponInfo['start_time'],
		'stop_show_time' => $couponInfo['stop_time'],
	]);
	$id = $couponInfo['coupon_id'];
	echo $id . "\r\n";
	echo $couponInfo['start_time'] . "\r\n";
	echo $couponInfo['stop_time'] . "\r\n";
	$couponInfo = mCouponConfig::get('*', [
		'start_show_time' => '0000-00-00 00:00:00',
		'stop_show_time' => '0000-00-00 00:00:00',
		'type_time' => mCouponConfig::TYPE_TIME_STATIC,
		'coupon_id[>]' => $id,
		'ORDER' => ['coupon_id' => 'ASC']
	]);
}
